package cn.sunagy.security.maz.auth.server.feign;

import cn.sunagy.security.maz.auth.server.configuration.FeignConfiguration;
import cn.sunagy.security.maz.common.response.ObjectRestResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @desc：#TODO fill me ！
 * @author：三餘無夢生
 * @date：2018/6/2
 * @time：下午4:43
 */
@FeignClient(value = "${jwt.user-service}",configuration = FeignConfiguration.class)
public interface IUserService {
    /**
     * 通过账户\密码的方式登陆
     * @param username
     * @param password
     * @return
     */
    @RequestMapping(value = "/user/validate", method = RequestMethod.POST)
    public ObjectRestResponse<Map<String,String>> validate(@RequestParam("username") String username, @RequestParam("password") String password);
    @RequestMapping(value = "/user/info", method = RequestMethod.POST)
    public ObjectRestResponse<Map<String,String>> getUserInfoByUsername(@RequestParam("username") String username);
}

